<HTML><HEAD><TITLE>sets(+SetVariables, ++Glb, ++Poss, +Functions)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">library(cardinal)</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>sets(+SetVariables, ++Glb, ++Poss, +Functions)</H1>
Set variables declaration with optional functions
<DL>
<DT><EM>SetVariables</EM></DT>
<DD>A list of variables.
</DD>
<DT><EM>Glb</EM></DT>
<DD>A ground set.
</DD>
<DT><EM>Poss</EM></DT>
<DD>A ground set.
</DD>
<DT><EM>Functions</EM></DT>
<DD>A list.
</DD>
</DL>
<H2>Description</H2>
Declare or constrain set domain variables to have Glb as assured
		elements and Poss as the possible additional elements.<P>
		Functions is a list of functions over each SetVariable in SetVariables in the form
		FunctionName:FunctionValue, where FunctionName can be 'cardinality',
		'minimum', 'maximum' or 'union':<P>
<PRE>
  cardinality: FunctionValue can be an integer, an FD variable or an integer domain (list or range)
  union: (SetVariable must be a set of sets.) FunctionValue can be a set, a set variable
	or a set domain in the form GlbUnion+PossUnion, representing the glb and poss of
	the union of SetVariable
  minimum and maximum: (SetVariable must be a nonempty set of integers.)
	FunctionValue can be an integer, an FD variable or an integer domain
</PRE>
		Cardinal inferences over SetVariable and its union, minimum and maximum
		functions will be performed only if these functions are explicitly
		declared, whereas the cardinality function and respective inferences
		will always be present even if this (cardinality) function is not
		explicitly declared. Note that a simple function declaration such as
		minimum:_ is sufficient to make it 'active'.<P>
		If a FunctionValue is given as a variable or as a fixed (integer or set)
		value, then it will be the same for all of SetVariables. If it is given
		as a domain, then function values for SetVariables may be different
		(a different domain variable is created for each SetVariable).
<H3>Fail Conditions</H3>
Fails if SetVariables can not be constrained accordingly.
<H3>Resatisfiable</H3>
No.
<H2>Examples</H2>
<PRE>
?- sets([S],[],[a,b],[]).
?- sets([S,T],[],[a,b],[cardinality:1]).
?- sets([X,Y,Z],[],[a,b],[cardinality:C]).
?- sets([X,Y,Z],[],[a,b],[cardinality:[0,2]]).
?- sets([X,Y,Z],[c],[a,b,d,e,f,g,h,i,j,k],[cardinality:[2,4..7]]).
?- sets([X,Y,Z],[],[1,3,4,5,7],[minimum:Min,maximum:1..9]), fd:(Max #&gt; Min+2).
?- sets([X,Y,Z], [], [[1,2,5],[2,4],[3,5],[1,3,4]], [union:[1]+[2,4,5]]).
</PRE>
<H2>See Also</H2>
<A HREF="../../lib_public/cardinal/set-4.html">set / 4</A>, <A HREF="../../lib_public/cardinal/BNN-2.html">`:: / 2</A>, <A HREF="../../lib_public/cardinal/cardinality-2.html">cardinality / 2</A>, <A HREF="../../lib_public/cardinal/union_var-2.html">union_var / 2</A>, <A HREF="../../lib_public/cardinal/minimum-2.html">minimum / 2</A>, <A HREF="../../lib_public/cardinal/maximum-2.html">maximum / 2</A>, <A HREF="../../lib_public/cardinal/set_labeling-1.html">set_labeling / 1</A>
</BODY></HTML>
